package com.kaibes.core.validator;

import static java.lang.annotation.ElementType.FIELD;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Documented
@Constraint(validatedBy = { RegexValidator.class })
@Target(FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Regex {

    String message() default "正则验证不通过";
    String regex();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    @Target(FIELD)
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    @interface List {
        Regex[] value();
    }
    
}
